import App from './App'
import {
	myHttpsApi
} from "src/utils/https.js"

import {
	reqGet,
	reqPost
} from "src/utils/api.js"

import {
	setLocalCarts,
	getLocalCarts,
	deleteCartItem,
	clearCart,
	updateCartItemCount
} from "src/store/store.js"


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import uView from 'uview-ui'
Vue.use(uView)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
//  挂载
Vue.prototype.$httpsApi = myHttpsApi;
Vue.prototype.$reqGet = reqGet;
Vue.prototype.$reqPost = reqPost;
//  存储到本地
Vue.prototype.$local_setLocalCarts = setLocalCarts;
Vue.prototype.$local_getLocalCarts = getLocalCarts;
Vue.prototype.$local_deleteCartItem = deleteCartItem;
Vue.prototype.$local_clearCart = clearCart;
Vue.prototype.$local_updateCartItemCount = updateCartItemCount;
// 过滤器
Vue.filter('formatDate', function(value, arm1) {
	return value + arm1 + 'YYYYMMDD'
})

//  设置 uview 的单位
uni.$u.config.unit = 'rpx'


// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif